<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>充值</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
	<div class="layui-form-item">		
		<div class="layui-form-item">
        <label class="layui-form-label">编号</label>
        <div class="layui-input-inline">
            <input type="text" id="userNo" name="userNo" placeholder="请输入会员编号" autocomplete="off" class="layui-input">
            <label id="noshow" style="color:red;" class="layui-form-mid">会员姓名</label>
        </div>
        <input type="text" id="userId" value="0" name="userId" placeholder="0" autocomplete="off" class="layui-input">
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">金额</label>
        <div class="layui-input-inline">
            <input type="text" id="amount" name="amount" value="0" placeholder="请输入金额" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-inline">
            <input type="text" id="remark" name="remark" value="充值" placeholder="请输入备注" autocomplete="off" class="layui-input">
        </div>
    </div>

        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-back-submit" value="确认">
        </div>

  </div>
</div>

<script src="/layui/layui.js"></script>
<script src="/layui/jquery.min.js"></script>
<script>
    layui.config({
        base: '/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function(){
        var $ = layui.$
            ,form = layui.form ;
    })

    var usernoId=0;
    $("#userNo").blur(function () {
        var urls="/user?url=User%2FgetUserAndNoInfo&userNo="+$("#userNo").val();
        var url = "/wap/getUserAndNoInfo?userNoId="+$("#userNo").val();
        $.ajax({
            url: urls,
            type: "GET",
            async:false,
            dataType: "json", //指定服务器返回的数据类型
            success: function(result) {
                if(result.code=="000000"){
                    if(result.data!=null){
                        usernoId=result.data.id;
                        $("#userId").val(usernoId);
                    }else {
                        usernoId=-1;
                        alert("编号不存在!!");
                    }
                }
            }
        });
    });

</script>
</body>
</html>